<div class="main-content">
    <h1><a name="Alert Subscriptions"></a>Alert Subscriptions</h1>

            <hr/>
            <h4 class="operation-heading"><a name="getSubscribedAlertTypes"></a>Get the list of API Publisher alert types subscribed by the user.
</h4> <code>GET https://apis.wso2.com/api/am/publisher/v1/alert-subscriptions</code>
            <p class="marked"></p>

            <p class="marked">This operation is used to get the list of subscribed alert types by the user.
</p>

            <h4 class="section-heading">OAuth 2.0 Scope</h4>
                <code>apim:pub_alert_manage</code>

            <h4 class="section-heading">
                Examples
            </h4>
            <h4 class="section-heading">
                <u></u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-getSubscribedAlertTypes">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-getSubscribedAlertTypes"class="pre collapse in"><code class="json">GET null HTTP 1/1
Authorization: Bearer eff01a97-4dc0-3542-a184-75aecf355ec2
</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-getSubscribedAlertTypes">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-getSubscribedAlertTypes" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json

{
  &quot;alerts&quot; : [ {
    &quot;id&quot; : 1,
    &quot;name&quot; : &quot;AbnormalRequestTime&quot;,
    &quot;configuration&quot; : [ {
      &quot;configurationId&quot; : &quot;UGl6emFTaGFja0FQSSMxLjAuMA&quot;,
      &quot;configuration&quot; : {
        &quot;apiName&quot; : &quot;PizzaShackAPI&quot;,
        &quot;apiVersion&quot; : &quot;1.0.0&quot;,
        &quot;requestTime&quot; : &quot;12&quot;
      }
    } ]
  } ],
  &quot;emailList&quot; : [ &quot;john@wso2.com&quot; ]
}</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X GET &#39;null&#39; -H &#39;Authorization: Bearer eff01a97-4dc0-3542-a184-75aecf355ec2&#39; </code></div>


            <h4 class="section-heading" id="scroll-to">Parameters</h4>
            <table class="table table-hover">
                <colgroup>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                    <col style="width: 40%;"/>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>Type</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Schema</th>
                    <th>Default</th>
                </tr>
                </thead>
            </table>

            <h4 class="section-heading">Responses</h4>

            <table class="table table-hover">
                <colgroup>
                    <col style="width: 15%;"/>
                    <col style="width: 70%;"/>
                    <col style="width: 15%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>HTTP Code</th>
                    <th>Description</th>
                    <th>Schema</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="parameter"><p class="marked">200</p></td>
                        <td class="parameter"><p class="marked">OK. The list of subscribed alert types are returned. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#AlertsInfo">AlertsInfo</a>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">500</p></td>
                        <td class="parameter"><p class="marked">Internal Server Error An error occurred while retrieving subscribed alert types by user. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#Error">Error</a>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <hr/>
            <h4 class="operation-heading"><a name="subscribeToAlerts"></a>Subscribe to the selected alert types by the user.
</h4> <code>PUT https://apis.wso2.com/api/am/publisher/v1/alert-subscriptions</code>
            <p class="marked"></p>

            <p class="marked">This operation is used to get the list of subscribed alert types by the user.
</p>

            <h4 class="section-heading">OAuth 2.0 Scope</h4>
                <code>apim:pub_alert_manage</code>

            <h4 class="section-heading">
                Examples
            </h4>
            <h4 class="section-heading">
                <u></u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-subscribeToAlerts">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-subscribeToAlerts"class="pre collapse in"><code class="json">PUT https://localhost:9443/api/am/publisher/v1/alert-subscriptions HTTP 1/1
Authorization: Bearer eff01a97-4dc0-3542-a184-75aecf355ec2
Content-Type: application/json

{
  &quot;alerts&quot; : [ {
    &quot;id&quot; : 1,
    &quot;name&quot; : &quot;AbnormalRequestsTime&quot;,
    &quot;configuration&quot; : [ {
      &quot;configurationId&quot; : &quot;UGl6emFTaGFja0FQSSMxLjAuMA&quot;,
      &quot;configuration&quot; : {
        &quot;apiName&quot; : &quot;PizzaShackAPI&quot;,
        &quot;apiVersion&quot; : &quot;1.0.0&quot;,
        &quot;requestTime&quot; : &quot;12&quot;
      }
    } ]
  } ],
  &quot;emailList&quot; : [ &quot;john@wso2.com&quot; ]
}</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-subscribeToAlerts">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-subscribeToAlerts" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json

{
  &quot;alerts&quot; : [ {
    &quot;id&quot; : 1,
    &quot;name&quot; : &quot;AbnormalRequestsPerMin&quot;,
    &quot;configuration&quot; : [ {
      &quot;configurationId&quot; : &quot;UGl6emFTaGFja0FQSSMxLjAuMA&quot;,
      &quot;configuration&quot; : {
        &quot;apiName&quot; : &quot;PizzaShackAPI&quot;,
        &quot;apiVersion&quot; : &quot;1.0.0&quot;,
        &quot;requestTime&quot; : &quot;12&quot;
      }
    } ]
  } ],
  &quot;emailList&quot; : [ &quot;string&quot; ],
  &quot;failedConfigurations&quot; : [ {
    &quot;configurationId&quot; : &quot;UGl6emFTaGFja0FQSSMxLjAuMA&quot;,
    &quot;configuration&quot; : {
      &quot;apiName&quot; : &quot;PizzaShackAPI&quot;,
      &quot;apiVersion&quot; : &quot;1.0.0&quot;,
      &quot;applicationName&quot; : &quot;DefaultApplication&quot;,
      &quot;requestTime&quot; : &quot;12&quot;
    }
  } ]
}</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X PUT &#39;https://localhost:9443/api/am/publisher/v1/alert-subscriptions&#39; -H &#39;Authorization: Bearer eff01a97-4dc0-3542-a184-75aecf355ec2&#39; -H &#39;Content-Type: application/json&#39; -d @payload.json</code></div>


            <h4 class="section-heading" id="scroll-to">Parameters</h4>
            <table class="table table-hover">
                <colgroup>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                    <col style="width: 40%;"/>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>Type</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Schema</th>
                    <th>Default</th>
                </tr>
                </thead>
                    <tr>
                        <td class="parameter">
                            
                            
                            
                            
                            <span class="param-in">Body </span>
                        </td>
                        <td class="param-name">
                            <p>body</p>
                            <p class="param-required">
                                required
                                
                            </p>
                        </td>
                        <td>
                            <p class="param-description marked">The alerts list and the email list to subscribe.</p>
                        </td>
                        <td>
                            <span class="param-type">
                                AlertsInfo
                                    (<a href="#!/models#AlertsInfo">AlertsInfo</a>)
                            </span>
                        </td>
                        <td>
                            <p class="marked"></p>
                        </td>
                    </tr>
            </table>

            <h4 class="section-heading">Responses</h4>

            <table class="table table-hover">
                <colgroup>
                    <col style="width: 15%;"/>
                    <col style="width: 70%;"/>
                    <col style="width: 15%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>HTTP Code</th>
                    <th>Description</th>
                    <th>Schema</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="parameter"><p class="marked">201</p></td>
                        <td class="parameter"><p class="marked">OK. Successful response with the newly subscribed alerts. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#AlertsInfoResponse">AlertsInfoResponse</a>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">400</p></td>
                        <td class="parameter"><p class="marked">Bad Request. Invalid Request or request validation failure. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">500</p></td>
                        <td class="parameter"><p class="marked">Internal Server Error An internal server error occurred while subscribing to alerts. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#Error">Error</a>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
            <hr/>
            <h4 class="operation-heading"><a name="unsubscribeAllAlerts"></a>Unsubscribe user from all the alert types.
</h4> <code>DELETE https://apis.wso2.com/api/am/publisher/v1/alert-subscriptions</code>
            <p class="marked"></p>

            <p class="marked">This operation is used to unsubscribe the respective user from all the alert types.
</p>

            <h4 class="section-heading">OAuth 2.0 Scope</h4>
                <code>apim:pub_alert_manage</code>

            <h4 class="section-heading">
                Examples
            </h4>
            <h4 class="section-heading">
                <u></u>
            </h4>
                <div class="pointer" data-toggle="collapse" data-target="#request-unsubscribeAllAlerts">
                    <h5 class="section-heading">
                        Request
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="request-unsubscribeAllAlerts"class="pre collapse in"><code class="json">DELETE https://localhost:9443/api/am/publisher/v1/alert-subscriptions HTTP 1/1
Authorization: Bearer eff01a97-4dc0-3542-a184-75aecf355ec2
Content-Type: application/json
</code></div>

                <div class="pointer" data-toggle="collapse" data-target="#response-unsubscribeAllAlerts">
                    <h5 class="section-heading">
                        Response
                            <span class="glyphicon glyphicon-collapse-down" aria-hidden="true"></span>
                    </h5>
                </div>
                    <div id="response-unsubscribeAllAlerts" class="pre collapse in"><code class="json">HTTP 1/1 200 OK
Content-Type: application/json
</code></div>

                <h5 class="section-heading">CURL</h5>
                    <div class="pre"><code class="bash">curl -k -v -X DELETE &#39;https://localhost:9443/api/am/publisher/v1/alert-subscriptions&#39; -H &#39;Authorization: Bearer eff01a97-4dc0-3542-a184-75aecf355ec2&#39; -H &#39;Content-Type: application/json&#39; </code></div>


            <h4 class="section-heading" id="scroll-to">Parameters</h4>
            <table class="table table-hover">
                <colgroup>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                    <col style="width: 40%;"/>
                    <col style="width: 10%;"/>
                    <col style="width: 20%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>Type</th>
                    <th>Name</th>
                    <th>Description</th>
                    <th>Schema</th>
                    <th>Default</th>
                </tr>
                </thead>
            </table>

            <h4 class="section-heading">Responses</h4>

            <table class="table table-hover">
                <colgroup>
                    <col style="width: 15%;"/>
                    <col style="width: 70%;"/>
                    <col style="width: 15%;"/>
                </colgroup>
                <thead>
                <tr class="active">
                    <th>HTTP Code</th>
                    <th>Description</th>
                    <th>Schema</th>
                </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="parameter"><p class="marked">200</p></td>
                        <td class="parameter"><p class="marked">OK. The user is unsubscribed from the alerts successfully. </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="parameter"><p class="marked">500</p></td>
                        <td class="parameter"><p class="marked">Internal Server Error </p></td>
                        <td class="parameter">
                            <span class="parameter">
                                    <a href="#!/models#Error">Error</a>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
</div>
